package com.test;

/**
 * 
 * @author xiandafu
 *
 */
public class JsonKey {
	private Object  name;
	private boolean isIndex;
	
	public JsonKey(Object name){
		this.name = name;
	}
	
	public JsonKey(Object name,boolean isIndex){
		this.name = name;
		this.isIndex = isIndex;
	}
	
	public Object getName() {
		return name;
	}
	public void setName(Object name) {
		this.name = name;
	}
	public boolean isIndex() {
		return isIndex;
	}
	public void setIndex(boolean isIndex) {
		this.isIndex = isIndex;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (isIndex ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		JsonKey other = (JsonKey) obj;
		if (isIndex != other.isIndex)
			return false;
		return true;
	}
	
}
